<?php include"../control/cookie.inc" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Cadastro Produto</title>
<?php include_once 'menu.inc'?>
<script src="js/jquery.validacao.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/formtabela.css" type="text/css"/>
<script src="js/formProduto.validacao.js" type="text/javascript"></script>
</head>
<body>
<form id="formularioProduto" method="post" action="../negocio/Ecommerce.php"
	enctype="multipart/form-data"><input type="hidden" name="operacao"
	value="cadastrarp"></input>
<table border="0" width="50%" cellpadding="2" cellspacing="1" align="center">
	<tr><th bgcolor="#990000" colspan="12" align="center">Cadastro Produto</th></tr>
	<tr>
		<td>Nome :</td>
		<td><input type="text" name="nome" size="30" /></td>
		<td></td>
	</tr>
	<tr>
		<td>Preco :</td>
		<td><input type="text" name="preco" size="30" /></td>
		<td></td>
	</tr>
	<tr>
		<td>Descricao :</td>
		<td><input type="text" name="descricao" size="30" /></td>
		<td></td>
	</tr>
	<tr>
		<td>Categoria :</td>
		<td><select name='categoria'>
		<?php
		include_once '../negocio/Conexao.php';
		try{
			$con = new Conexao();
			$sql = $con->query("Select nome from categoria order by nome asc");
			$sql->execute();
			$resultado = $sql->fetchAll(PDO::FETCH_ASSOC);
			foreach($resultado as $campo){
				echo $campo['nome'];
				?>
			<option><?php echo $campo['nome']?></option>
			<?php
			}
		}
		catch(PDOException $p){
			$p->getMessage();
		}

		?>
		</select></td>
	</tr>
	<tr>
		<td>Nome Imagem :</td>
		<td><input type="text" size="30" name="nomeimagem" /></td>
		<td></td>
	</tr>
	<tr>
		<td>Imagem :</td>
		<td><input type="file" " size="30" name="foto" /></td>
		<td></td>
	</tr>
<tr>
<td>
<input class="button" type="submit" value="Cadastrar"></input>
</td>
</tr>
</table>
</form>
<?php include 'rodape.inc'?>
</body>
</html>